package server;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.rmi.RemoteException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JTabbedPane;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.JLabel;

public class serverMainFrame extends JFrame {
	private Data data;

	private JPanel contentPane;
	private JTable table;
	private JTable table_1;
	private JTable table_2;
	private JTable table_3;
	private JTable table_4;
	private JTable table_5;
	private JTable table_6;
	private JTable table_7;
	private JTable table_8;
	private JTable table_9;
	private JTable table_10;
	private JTable table_11;
	private JTable table_12;
	private JTable table_13;
	private JTable table_14;
	private JTable table_15;
	private JTable table_16;
	private JTable table_17;


	public serverMainFrame() throws SQLException {
		super("虚拟城市后台管理");
		data=new Data();
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 736, 560);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(0, 0, 720, 469);
		contentPane.add(tabbedPane);
		
		JPanel panel_6 = new JPanel();
		tabbedPane.addTab("欢迎", null, panel_6, null);
		
		JLabel label = new JLabel("欢迎登录虚拟城市服务器管理系统！");
		panel_6.add(label);
		
		JPanel panel = new JPanel();
		tabbedPane.addTab("帐号", null, panel, null);
		panel.setLayout(null);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(10, 10, 695, 420);
		panel.add(scrollPane);
		
		
		
		String sql1="select * from person";
		ResultSet rs1=data.getResultSet(sql1);
		
		String col1[]={"id","username","password","name","sex","cash","ComId","hp","hap","exp","Job"};

		Person p=null;
		try {
			p=new Person();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		int persize=p.getSize();

		Object[][] per=new Object[persize][];
		int i=0;
		try {
			while(rs1.next())
			{
				per[i]=new Object[11];
				per[i][0]=new Integer(rs1.getInt("id"));
				per[i][1]=new String(rs1.getString("username"));
				per[i][2]=new String(rs1.getString("password"));
				per[i][3]=new String(rs1.getString("name"));
				per[i][4]=new String(rs1.getString("sex"));
				per[i][5]=new Double(rs1.getDouble("cash"));
				per[i][6]=new Integer(rs1.getInt("ComId"));
				per[i][7]=new Integer(rs1.getInt("hp"));
				per[i][8]=new Integer(rs1.getInt("hap"));
				per[i][9]=new Integer(rs1.getInt("exp"));
				per[i][10]=new String(rs1.getString("Job"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}

		table = new JTable(per,col1);
		
		scrollPane.setViewportView(table);
	
		/////////////////////////////////////////////////////////////////////
		
		
		JPanel panel_1 = new JPanel();
		tabbedPane.addTab("银行", null, panel_1, null);
		panel_1.setLayout(null);
		
		JTabbedPane tabbedPane_1 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_1.setBounds(10, 10, 695, 420);
		panel_1.add(tabbedPane_1);
		
		////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_1 = new JScrollPane();
		tabbedPane_1.addTab("bankacclist", null, scrollPane_1, null);
		
		String sql2="select * from bankacclist";
		ResultSet rs2=data.getResultSet(sql2);
		String col2[]={"id","name","bkey","caBalance","pID"};

		BankAccList ba=null;
		ba=new BankAccList();
		int basize=ba.getSize();
		
		Object[][] balist=new Object[basize][];
		i=0;
		try {
			while(rs2.next())
			{
				balist[i]=new Object[5];
				balist[i][0]=new Integer(rs2.getInt("id"));
				balist[i][1]=new String(rs2.getString("name"));
				balist[i][2]=new Integer(rs2.getInt("bkey"));
				balist[i][3]=new Double(rs2.getDouble("caBalance"));
				balist[i][4]=new Integer(rs2.getInt("pID"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}

		table_1 = new JTable(balist,col2);
		scrollPane_1.setViewportView(table_1);
		//////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_2 = new JScrollPane();
		tabbedPane_1.addTab("bankstafflist", null, scrollPane_2, null);
		
		String sql3="select * from bankstafflist";
		ResultSet rs3=data.getResultSet(sql3);
		String col3[]={"id","pID","caNum","enterkey","name"};

		BankStaffList bs=null;
		bs=new BankStaffList();
		int bssize=bs.getSize();
		
		Object[][] bslist=new Object[bssize][];
		i=0;
		try {
			while(rs3.next())
			{
				bslist[i]=new Object[5];
				bslist[i][0]=new Integer(rs3.getInt("id"));
				bslist[i][1]=new Integer(rs3.getInt("pID"));
				bslist[i][2]=new Integer(rs3.getInt("caNum"));
				bslist[i][3]=new Integer(rs3.getInt("enterkey"));
				bslist[i][4]=new String(rs3.getString("name"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_2 = new JTable(bslist,col3);
		scrollPane_2.setViewportView(table_2);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_3 = new JScrollPane();
		tabbedPane_1.addTab("bankwanterlist", null, scrollPane_3, null);
		
		String sql4="select * from bankwanterlist";
		ResultSet rs4=data.getResultSet(sql4);
		String col4[]={"id","pID","caNum","enterkey","name"};

		BankWanterList bw=null;
		bw=new BankWanterList();
		int bwsize=bw.getSize();
		
		Object[][] bwlist=new Object[bwsize][];
		i=0;
		try {
			while(rs4.next())
			{
				bwlist[i]=new Object[5];
				bwlist[i][0]=new Integer(rs4.getInt("id"));
				bwlist[i][1]=new Integer(rs4.getInt("pID"));
				bwlist[i][2]=new Integer(rs4.getInt("caNum"));
				bwlist[i][3]=new Integer(rs4.getInt("enterkey"));
				bwlist[i][4]=new String(rs4.getString("name"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_3 = new JTable(bwlist,col4);
		scrollPane_3.setViewportView(table_3);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_4 = new JScrollPane();
		tabbedPane_1.addTab("facclist", null, scrollPane_4, null);
		
		String sql5="select * from facclist";
		ResultSet rs5=data.getResultSet(sql5);
		String col5[]={"id","pID","faNum","faSum","faLimit","faStartTime"};

		BankFAccList fa=null;
		fa=new BankFAccList();
		int fasize=fa.getSize();
		
		Object[][] falist=new Object[fasize][];
		i=0;
		try {
			while(rs5.next())
			{
				falist[i]=new Object[6];
				falist[i][0]=new Integer(rs5.getInt("id"));
				falist[i][1]=new Integer(rs5.getInt("pID"));
				falist[i][2]=new Integer(rs5.getInt("faNum"));
				falist[i][3]=new Double(rs5.getDouble("faSum"));
				falist[i][4]=new Integer(rs5.getInt("faLimit"));
				falist[i][5]=new String(rs5.getString("faStartTime"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_4 = new JTable(falist,col5);
		scrollPane_4.setViewportView(table_4);
		
		/////////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_5 = new JScrollPane();
		tabbedPane_1.addTab("lacclist", null, scrollPane_5, null);
		
		String sql6="select * from lacclist";
		ResultSet rs6=data.getResultSet(sql6);
		String col6[]={"id","pID","laNum","laSum","laLimit","laStartTime"};

		BankLAccList la=null;
		la=new BankLAccList();
		int lasize=la.getSize();
		
		Object[][] lalist=new Object[lasize][];
		i=0;
		try {
			while(rs6.next())
			{
				lalist[i]=new Object[6];
				lalist[i][0]=new Integer(rs6.getInt("id"));
				lalist[i][1]=new Integer(rs6.getInt("pID"));
				lalist[i][2]=new Integer(rs6.getInt("laNum"));
				lalist[i][3]=new Double(rs6.getDouble("laSum"));
				lalist[i][4]=new Integer(rs6.getInt("laLimit"));
				lalist[i][5]=new String(rs6.getString("laStartTime"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_5 = new JTable(lalist,col6);
		scrollPane_5.setViewportView(table_5);
		
		////////////////////////////////////////////////////////////////////////
		
		JPanel panel_2 = new JPanel();
		tabbedPane.addTab("公司", null, panel_2, null);
		panel_2.setLayout(null);
		
		JTabbedPane tabbedPane_2 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_2.setBounds(10, 10, 695, 420);
		panel_2.add(tabbedPane_2);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_6 = new JScrollPane();
		tabbedPane_2.addTab("company", null, scrollPane_6, null);
		
		String sql7="select * from company";
		ResultSet rs7=data.getResultSet(sql7);
		String col7[]={"id","name","founds","loanVal","maxLoanVal","staffNum","maxStaffNum","maxInvestFounds","equipmentLev","maxEquipmentLev","maxMarketResFounds"};

		Company cm;
		int cmsize=0;
		try {
			cm = new Company();
			cmsize=cm.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		Object[][] cmlist=new Object[cmsize][];
		i=0;
		try {
			while(rs7.next())
			{
				cmlist[i]=new Object[11];
				cmlist[i][0]=new Integer(rs7.getInt("id"));
				cmlist[i][1]=new String(rs7.getString("name"));
				cmlist[i][2]=new Double(rs7.getDouble("founds"));
				cmlist[i][3]=new Double(rs7.getDouble("loanVal"));
				cmlist[i][4]=new Double(rs7.getDouble("maxLoanVal"));
				cmlist[i][5]=new Integer(rs7.getInt("staffNum"));
				cmlist[i][6]=new Integer(rs7.getInt("maxStaffNum"));
				cmlist[i][7]=new Integer(rs7.getInt("maxInvestFounds"));
				cmlist[i][8]=new Integer(rs7.getInt("equipmentLev"));
				cmlist[i][9]=new Integer(rs7.getInt("maxEquipmentLev"));
				cmlist[i][10]=new Integer(rs7.getInt("maxMarketResFounds"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_6 = new JTable(cmlist,col7);
		scrollPane_6.setViewportView(table_6);
		
		////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_7 = new JScrollPane();
		tabbedPane_2.addTab("comstaff", null, scrollPane_7, null);
		
		String sql8="select * from comstaff";
		ResultSet rs8=data.getResultSet(sql8);
		String col8[]={"id","post","level","salary","consumhp","consumhap","exp","upExp","companyId"};

		Staff cs=null;
		int cssize=0;
		try {
			cs=new Staff();
			cssize=cs.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] cslist=new Object[cssize][];
		i=0;
		try {
			while(rs8.next())
			{
				cslist[i]=new Object[9];
				cslist[i][0]=new Integer(rs8.getInt("id"));
				cslist[i][1]=new String(rs8.getString("post"));
				cslist[i][2]=new Integer(rs8.getInt("level"));
				cslist[i][3]=new Double(rs8.getDouble("salary"));
				cslist[i][4]=new Integer(rs8.getInt("consumhp"));
				cslist[i][5]=new Integer(rs8.getInt("consumhap"));
				cslist[i][6]=new Double(rs8.getDouble("exp"));
				cslist[i][7]=new Double(rs8.getDouble("upExp"));
				cslist[i][8]=new Integer(rs8.getInt("companyId"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_7 = new JTable(cslist,col8);
		scrollPane_7.setViewportView(table_7);
		
		///////////////////////////////////////////////////////////////////////
		
		JPanel panel_3 = new JPanel();
		tabbedPane.addTab("社区", null, panel_3, null);
		panel_3.setLayout(null);
		
		JTabbedPane tabbedPane_3 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_3.setBounds(10, 10, 695, 420);
		panel_3.add(tabbedPane_3);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_8 = new JScrollPane();
		tabbedPane_3.addTab("combuylist", null, scrollPane_8, null);
		
		String sql9="select * from combuylist";
		ResultSet rs9=data.getResultSet(sql9);
		String col9[]={"id","housekind","hap","money","num"};

		ComBuyList cb=null;
		int cbsize=0;
		try {
			cb=new ComBuyList();
			cbsize=cb.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] cblist=new Object[cbsize][];
		i=0;
		try {
			while(rs9.next())
			{
				cblist[i]=new Object[5];
				cblist[i][0]=new Integer(rs9.getInt("id"));
				cblist[i][1]=new String(rs9.getString("housekind"));
				cblist[i][2]=new Integer(rs9.getInt("hap"));
				cblist[i][3]=new Double(rs9.getDouble("money"));
				cblist[i][4]=new Integer(rs9.getInt("num"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_8 = new JTable(cblist,col9);
		scrollPane_8.setViewportView(table_8);
		
		///////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_9 = new JScrollPane();
		tabbedPane_3.addTab("comhouselist", null, scrollPane_9, null);
		
		String sql10="select * from comhouselist";
		ResultSet rs10=data.getResultSet(sql10);
		String col10[]={"id","houseClassify","ckey","ownerId"};

		ComHouseList ch=null;
		int chsize=0;
		try {
			ch=new ComHouseList();
			chsize=ch.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] chlist=new Object[chsize][];
		i=0;
		try {
			while(rs10.next())
			{
				chlist[i]=new Object[4];
				chlist[i][0]=new Integer(rs10.getInt("id"));
				chlist[i][1]=new String(rs10.getString("houseClassify"));
				chlist[i][2]=new String(rs10.getString("cKey")==null?"":rs10.getString("cKey"));
				chlist[i][3]=new Integer(rs10.getInt("ownerId"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_9 = new JTable(chlist,col10);
		scrollPane_9.setViewportView(table_9);
		
		///////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_10 = new JScrollPane();
		tabbedPane_3.addTab("comwork", null, scrollPane_10, null);
		
		String sql11="select * from comwork";
		ResultSet rs11=data.getResultSet(sql11);
		String col11[]={"id","action","hp","hap"};

		ComActionList ca=null;
		int casize=0;
		try {
			ca=new ComActionList();
			casize=ca.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] calist=new Object[casize][];
		i=0;
		try {
			while(rs11.next())
			{
				calist[i]=new Object[4];
				calist[i][0]=new Integer(rs11.getInt("id"));
				calist[i][1]=new String(rs11.getString("action"));
				calist[i][2]=new Integer(rs11.getInt("hp"));
				calist[i][3]=new Integer(rs11.getInt("hap"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_10 = new JTable(calist,col11);
		scrollPane_10.setViewportView(table_10);
		
		/////////////////////////////////////////////////////////////////////////
		
		JPanel panel_4 = new JPanel();
		tabbedPane.addTab("餐馆", null, panel_4, null);
		panel_4.setLayout(null);
		
		JTabbedPane tabbedPane_4 = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane_4.setBounds(10, 10, 695, 420);
		panel_4.add(tabbedPane_4);
		
		////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_11 = new JScrollPane();
		tabbedPane_4.addTab("dish", null, scrollPane_11, null);
		
		String sql13="select * from dish";
		ResultSet rs13=data.getResultSet(sql13);
		String col13[]={"id","tableId","staffId","money","date","dinnerNum"};

		ResDinnerInfo dish=null;
		int dishsize=0;
		try {
			dish=new ResDinnerInfo();
			dishsize=dish.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] dishlist=new Object[dishsize][];
		i=0;
		try {
			while(rs13.next())
			{
				dishlist[i]=new Object[6];
				dishlist[i][0]=new Integer(rs13.getInt("id"));
				dishlist[i][1]=new Integer(rs13.getInt("tableId"));
				dishlist[i][2]=new Integer(rs13.getInt("staffId"));
				dishlist[i][3]=new Double(rs13.getDouble("money"));
				dishlist[i][4]=new String(rs13.getString("date")==null?"":rs13.getString("date"));
				dishlist[i][5]=new Integer(rs13.getInt("dinnerNum"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_11 = new JTable(dishlist,col13);
		scrollPane_11.setViewportView(table_11);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_12 = new JScrollPane();
		tabbedPane_4.addTab("menu", null, scrollPane_12, null);
		
		String sql14="select * from menu";
		ResultSet rs14=data.getResultSet(sql14);
		String col14[]={"id","name","price","connsumHp","kind"};

		ResMenuList menu=null;
		int menusize=0;
		try {
			menu=new ResMenuList();
			menusize=menu.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] menulist=new Object[menusize][];
		i=0;
		try {
			while(rs14.next())
			{
				menulist[i]=new Object[5];
				menulist[i][0]=new Integer(rs14.getInt("id"));
				menulist[i][1]=new String(rs14.getString("name"));
				menulist[i][2]=new Double(rs14.getDouble("price"));
				menulist[i][3]=new Double(rs14.getDouble("consumHp"));
				menulist[i][4]=new Integer(rs14.getInt("kind"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_12 = new JTable(menulist,col14);
		scrollPane_12.setViewportView(table_12);
		
		////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_13 = new JScrollPane();
		tabbedPane_4.addTab("resorder", null, scrollPane_13, null);
		
		String sql15="select * from resorder";
		ResultSet rs15=data.getResultSet(sql15);
		String col15[]={"id","workNum","pNum","name","phone","date"};

		ResBookInfo resorder=null;
		int resordersize=0;
		try {
			resorder=new ResBookInfo();
			resordersize=resorder.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] resorderlist=new Object[resordersize][];
		i=0;
		try {
			while(rs15.next())
			{
				resorderlist[i]=new Object[6];
				resorderlist[i][0]=new Integer(rs15.getInt("id"));
				resorderlist[i][1]=new Integer(rs15.getInt("workNum"));
				resorderlist[i][2]=new Integer(rs15.getInt("pNum"));
				resorderlist[i][3]=new String(rs15.getString("name"));
				resorderlist[i][4]=new String(rs15.getString("phone"));
				resorderlist[i][5]=new String(rs15.getString("date"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_13 = new JTable(resorderlist,col15);
		scrollPane_13.setViewportView(table_13);
		
		//////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_14 = new JScrollPane();
		tabbedPane_4.addTab("resstaff", null, scrollPane_14, null);
		
		String sql16="select * from resstaff";
		ResultSet rs16=data.getResultSet(sql16);
		String col16[]={"id","workClassify","name","salary","sex","age"};

		ResStaff resstaff=null;
		int resstaffsize=0;
		resstaff=new ResStaff();
		resstaffsize=resstaff.getSize();
		
		
		Object[][] resstafflist=new Object[resstaffsize][];
		i=0;
		try {
			while(rs16.next())
			{
				resstafflist[i]=new Object[6];
				resstafflist[i][0]=new Integer(rs16.getInt("id"));
				resstafflist[i][1]=new Integer(rs16.getInt("workClassify"));
				resstafflist[i][2]=new String(rs16.getString("name"));
				resstafflist[i][3]=new String(rs16.getString("salary"));
				resstafflist[i][4]=new Integer(rs16.getInt("sex"));
				resstafflist[i][5]=new Integer(rs16.getInt("age"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_14 = new JTable(resstafflist,col16);
		scrollPane_14.setViewportView(table_14);
		
		/////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_15 = new JScrollPane();
		tabbedPane_4.addTab("restable", null, scrollPane_15, null);
		
		String sql17="select * from restable";
		ResultSet rs17=data.getResultSet(sql17);
		String col17[]={"id","size","status"};

		ResTable restable=null;
		int restablesize=0;
		try {
			restable=new ResTable();
			restablesize=restable.getTableListSize();
		} catch (RemoteException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		
		
		Object[][] restablelist=new Object[restablesize][];
		i=0;
		try {
			while(rs17.next())
			{
				restablelist[i]=new Object[3];
				restablelist[i][0]=new Integer(rs17.getInt("id"));
				restablelist[i][1]=new Integer(rs17.getInt("size"));
				restablelist[i][2]=new Integer(rs17.getInt("status"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_15 = new JTable(restablelist,col17);
		scrollPane_15.setViewportView(table_15);
		
		/////////////////////////////////////////////////////////////////////////
		
		JScrollPane scrollPane_16 = new JScrollPane();
		tabbedPane_4.addTab("takeout", null, scrollPane_16, null);
		
		String sql18="select * from takeout";
		ResultSet rs18=data.getResultSet(sql18);
		String col18[]={"id","name","phone","address","money","date"};

		ResTakeOutInfo takeout=null;
		int takeoutsize=0;
		try {
			takeout=new ResTakeOutInfo();
			takeoutsize=takeout.getSize();
		} catch (RemoteException e2) {
			// TODO Auto-generated catch block
			e2.printStackTrace();
		}
		
		
		Object[][] takeoutlist=new Object[takeoutsize][];
		i=0;
		try {
			while(rs18.next())
			{
				takeoutlist[i]=new Object[6];
				takeoutlist[i][0]=new Integer(rs18.getInt("id"));
				takeoutlist[i][1]=new String(rs18.getString("name"));
				takeoutlist[i][2]=new String(rs18.getString("phone"));
				takeoutlist[i][3]=new String(rs18.getString("address"));
				takeoutlist[i][4]=new Double(rs18.getDouble("money"));
				takeoutlist[i][5]=new String(rs18.getString("date"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_16 = new JTable(takeoutlist,col18);
		scrollPane_16.setViewportView(table_16);
		
		///////////////////////////////////////////////////////////////////////
		
		JPanel panel_5 = new JPanel();
		tabbedPane.addTab("地铁", null, panel_5, null);
		panel_5.setLayout(null);
		
		JScrollPane scrollPane_17 = new JScrollPane();
		scrollPane_17.setBounds(10, 10, 695, 420);
		panel_5.add(scrollPane_17);
		
		String sql12="select * from location";
		ResultSet rs12=data.getResultSet(sql12);
		String col12[]={"id","name","locationNum","stationNum"};

		Location lo=null;
		int losize=0;
		try {
			lo=new Location();
			losize=lo.getSize();
		} catch (RemoteException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		
		Object[][] lolist=new Object[losize][];
		i=0;
		try {
			while(rs12.next())
			{
				lolist[i]=new Object[4];
				lolist[i][0]=new Integer(rs12.getInt("id"));
				lolist[i][1]=new String(rs12.getString("name"));
				lolist[i][2]=new Integer(rs12.getInt("locationNum"));
				lolist[i][3]=new Integer(rs12.getInt("stationNum"));
				i++;
			}
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		table_17 = new JTable(lolist,col12);
		scrollPane_17.setViewportView(table_17);
	}
}
